home *** CD-ROM | disk | FTP | other *** search
Text File | 1995-07-11 | 5.7 KB | 121 lines | [TEXT/PJMM] |
- {****************************************************}
- {}
- { CFSHelpDirector.p }
- {}
- { Director methods for the help window. }
- {}
- { Copyright © 1995, Patrick Hew. All rights reserved. }
- {}
- {****************************************************}
-
-
- unit CFSHelpDirector;
-
- interface
-
- uses
- TCL, FSIntf;
-
- implementation
-
- const
-
- { Dimensions. }
-
- kEdgeMargin = 4;
-
- kNumButtons = 4;
- kButtonLenh = (kFSHelpWindh - kEdgeMargin) div kNumButtons - kEdgeMargin;
- kButtonLenv = 20;
-
- kAboutPosh = kEdgeMargin;
- kFlyingPosh = kAboutPosh + kButtonLenh + kEdgeMargin;
- kStabilityPosh = kFlyingPosh + kButtonLenh + kEdgeMargin;
- kDrawingPosh = kStabilityPosh + kButtonLenh + kEdgeMargin;
- kButtonsPosv = kFSHelpWindv - kEdgeMargin - kButtonLenv;
-
- kPictureLenh = kFSHelpWindh; { 318 }
- kPictureLenv = kButtonsPosv - kEdgeMargin; { 434 -4-20-4 = 406 }
-
-
- { IFSHelpDirector }
- {}
- { Post: Our help director has been initialized. }
-
- procedure CFSHelpDirector.IFSHelpDirector (aSupervisor: CDirectorOwner);
-
- begin { IFSHelpDirector }
- IDirector(aSupervisor);
-
- itsPicture := nil;
-
- itsCreditsButton := nil;
- itsFlyingButton := nil;
- itsStabilityButton := nil;
- itsDrawingButton := nil;
-
- { itsMode is initialized in BuildWindow. }
-
- end; { IFSHelpDirector }
-
-
- { Free }
- {}
- { Post: Our help director has been disposed of. }
-
- procedure CFSHelpDirector.Free;
-
- begin { Free }
- itsPicture := nil;
-
- itsCreditsButton := nil;
- itsFlyingButton := nil;
- itsStabilityButton := nil;
- itsDrawingButton := nil;
-
- inherited Free;
- end; { Free }
-
-
- { BuildWindow }
- {}
- { Post: The floating window which the help director supervises has been built. }
-
- procedure CFSHelpDirector.BuildWindow;
-
- var
- theWindow: CWindow;
- thePicture: CPicture;
- theButton: CButton;
-
- begin { BuildWindow }
- { The help window is a floating one. }
- new(theWindow);
- theWindow.IWindow(WINDHelp, TRUE, gDesktop, SELF);
- itsWindow := theWindow;
-
- { We don't want to have to select the window before having it act. }
- itsWindow.SetActClick(TRUE);
-
- { The window is initially hidden, set by the resource. }
- { We don't use the decorator, because it CenterWindow puts the window at the }
- { centre of the desktop, when what we want is to centre the game and help }
- { windows on the primary screen. }
- { Align to of help window to top of game window. }
- theWindow.Move((screenBits.bounds.right - screenBits.bounds.left + kFSGameWindh - kFSHelpWindh) div 2, (screenBits.bounds.bottom - screenBits.bounds.top - kFSGameWindv) div 2 + 20);
-
- { The picture pane, in which everything appears. }
-
- new(thePicture);
- thePicture.IPicture(itsWindow, SELF, kPictureLenh, kPictureLenv, 0, 0, sizFIXEDSTICKY, sizFIXEDSTICKY);
- itsPicture := thePicture;
-
- { Topic buttons. }
-
- new(theButton);
- theButton.INewButton(kButtonLenh, kButtonLenv, kAboutPosh, kButtonsPosv, 'Credits', kVisible, 0, itsWindow, SELF);
- theButton.SetClickCmd(cmdModeCredits);
- itsCreditsButton := theButton;
-
- new(theButton);
-